import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/a',
    name: 'Home',
    component: Home,
    children: [{
        path: '/index',
        component: () =>
            import ('@/components/Home')
    }, {
        path: '/a',
        redirect: '/index'
    }, {
        path: '/allgoods',
        component: () =>
            import ('@/components/AllGoods')
    }, {
        path: '/about',
        component: () =>
            import ('@/components/About')
    }, {
        path: '/order',
        component: () =>
            import ('@/components/Order')
    }, {
        path: '/collection',
        component: () =>
            import ('@/components/Collection')
    }, ]
}, {
    path: '/',
    redirect: '/a'
}]

const router = new VueRouter({
    routes
})

export default router